package com.iplant.basic.service.po.bms;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.base.utils.annotation.join.multi.DBJoinMulti;
import com.iplant.base.utils.annotation.po.DBBasePO;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


/**
 * 班组管理
 *
 * @author YouWang·Peng
 * 2023-7-14 21:34:40
 */
@DBBasePO(TableName = "bms_classinfo", CheckName = {"DepartmentID"})
public class BMSClassInfo extends BasePO implements Serializable {

    /**
     * 序列号
     */
    private static final long serialVersionUID = 1L;

    @DBField
    @DBCondition
    public int ParentDepartmentID = 0;

    /**
     * 班组名称（来源于部门）
     */
    @DBCondition
    @DBJoin(name = "Name", tableName = "bms_department", tableAsName = "t2", Schemas = DBSchemas.Basic,
            MainTableField = "ParentDepartmentID")
    public String ParentDepartmentName = "";

    /**
     * 班组编码（来源于部门）
     */
    @DBCondition
    @DBJoin(name = "Code", tableName = "bms_department", tableAsName = "t2", Schemas = DBSchemas.Basic,
            MainTableField = "ParentDepartmentID")
    public String ParentDepartmentCode = "";

    /**
     * 班组ID（来源于部门）
     */
    @DBField
    @DBCondition
    public int DepartmentID = 0;

    /**
     * 班组名称（来源于部门）
     */
    @DBCondition
    @DBJoin(name = "Name", tableName = "bms_department", tableAsName = "t1", Schemas = DBSchemas.Basic,
            MainTableField = "DepartmentID")
    public String DepartmentName = "";

    /**
     * 班组编码（来源于部门）
     */
    @DBCondition
    @DBJoin(name = "Code", tableName = "bms_department", tableAsName = "t1", Schemas = DBSchemas.Basic,
            MainTableField = "DepartmentID")
    public String DepartmentCode = "";

    /**
     * 班组人员
     */
    public List<BMSEmployee> MemberList = new ArrayList<>();

    /**
     * 班组长（部门长，可多选）
     */
    @DBField
    public String MonitorIDs = "";

    /**
     * 班组长（翻译）
     */
    @DBJoinMulti(Name = "Name", TableName = "mbs_user", MainTableField = "MonitorIDs")
    public String MonitorList = "";

    /**
     * 班组职能
     */
    @DBCondition
    @DBField
    public int FunctionType = 0;

    /**
     * 班组职能（翻译）
     */
//    @EnumDesc(MainTableField = "FunctionType", EnumClass = "com.iplant.ams.service.basicenum.ams.FunctionType")
    public String FunctionTypeName = "";

    /**
     * 班组人数
     */
    public int MemberNumber = 0;

    /**
     * 资产分类(树形)
     */
    public BMSClassInfo() {
        super();
    }

    @JsonProperty("MemberNumber")
    public int getMemberNumber() {
        return MemberNumber;
    }

    public void setMemberNumber(int memberNumber) {
        MemberNumber = memberNumber;
    }

    @JsonProperty("DepartmentID")
    public int getDepartmentID() {
        return DepartmentID;
    }

    public void setDepartmentID(int departmentID) {
        DepartmentID = departmentID;
    }

    @JsonProperty("DepartmentName")
    public String getDepartmentName() {
        return DepartmentName;
    }

    public void setDepartmentName(String departmentName) {
        DepartmentName = departmentName;
    }

    @JsonProperty("DepartmentCode")
    public String getDepartmentCode() {
        return DepartmentCode;
    }

    public void setDepartmentCode(String departmentCode) {
        DepartmentCode = departmentCode;
    }

    @JsonProperty("MemberList")
    public List<BMSEmployee> getMemberList() {
        return MemberList;
    }

    @JsonProperty("MonitorIDs")
    public String getMonitorIDs() {
        return MonitorIDs;
    }

    public void setMonitorIDs(String monitorIDs) {
        MonitorIDs = monitorIDs;
    }

    @JsonProperty("MonitorList")
    public String getMonitorList() {
        return MonitorList;
    }

    @JsonProperty("FunctionType")
    public int getFunctionType() {
        return FunctionType;
    }

    public void setFunctionType(int functionType) {
        FunctionType = functionType;
    }

    @JsonProperty("FunctionTypeName")
    public String getFunctionTypeName() {
        return FunctionTypeName;
    }

    public void setFunctionTypeName(String functionTypeName) {
        FunctionTypeName = functionTypeName;
    }

    public void setMemberList(List<BMSEmployee> memberList) {
        MemberList = memberList;
    }

    public void setMonitorList(String monitorList) {
        MonitorList = monitorList;
    }

    @JsonProperty("ParentDepartmentID")
    public int getParentDepartmentID() {
        return ParentDepartmentID;
    }

    public void setParentDepartmentID(int parentDepartmentID) {
        ParentDepartmentID = parentDepartmentID;
    }

    @JsonProperty("ParentDepartmentName")
    public String getParentDepartmentName() {
        return ParentDepartmentName;
    }

    public void setParentDepartmentName(String parentDepartmentName) {
        ParentDepartmentName = parentDepartmentName;
    }

    @JsonProperty("ParentDepartmentCode")
    public String getParentDepartmentCode() {
        return ParentDepartmentCode;
    }

    public void setParentDepartmentCode(String parentDepartmentCode) {
        ParentDepartmentCode = parentDepartmentCode;
    }
}
